#!/bin/bash
path=/123
find "$path" -type f -name "*.txt"|xargs -i mv {} {}.bak
cd /
tar zcvf $path/123.tar.gz 123
cd /123
rename ".bak" "" *